var express = require('express');
var router = express.Router();
var Model = require('../models/movie');

/* GET home page. */
router.get('/', function (req, res, next) {
    Model.find({}, function (err, movies) {
        console.log("session:" + JSON.stringify(req.session.user));
        res.render('index', {
            title: '首页',
            movies: movies
        });
    })
});

module.exports = router;
